﻿<UserControl
    x:Class="FU.Capstones.IMS.Web.Silverlight.Controls.MenuControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:TNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:MultiBindingHelpers="clr-namespace:FU.Capstones.IMS.Web.Common.MultiBindingHelpers;assembly=FU.Capstones.IMS.Web.Common">
    
    <Grid 
        x:Name="LayoutRoot"
        Style="{StaticResource MenuGridStyle}"
        >
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Border>
            <Border.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FF55667C" Offset="{StaticResource ControlBackgroundGradientStop0}"/>
                    <GradientStop Color="#FF0B0A6C" Offset="{StaticResource ControlBackgroundGradientStop1}"/>
                    <GradientStop Color="#FF0B0A6C" Offset="{StaticResource ControlBackgroundGradientStop2}"/>
                    <GradientStop Color="#FF55667C" Offset="{StaticResource ControlBackgroundGradientStop3}"/>
                </LinearGradientBrush>
            </Border.Background>
            <TextBlock
                Text="Menu"
                Style="{StaticResource MenuTitleStyle}"           
            />
        </Border>

        <TNavigation:RadPanelBar 
            Grid.Row="1"
            >
            <!--ExportImportMManagement-->
            <TNavigation:RadPanelBarItem
				Style="{StaticResource RadPanelBarItemStyle}"
                Visibility="{Binding Path=IEManagementVisibility, Mode=OneWay}"
                >
                <TNavigation:RadPanelBarItem.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock 
                            Style="{StaticResource TextBlockMenuHeaderStyle}"
                            Text="{StaticResource IEMangHeaderText}"
                        />
                    </DataTemplate>
                </TNavigation:RadPanelBarItem.HeaderTemplate>
                <StackPanel>
                    <Controls:RadRadioButton 
            		    GroupName="Menu"
            		    x:Name="rrdEIMManagement"
            		    Content="Nhập/xuất kho"
            		    Click="OnChecked"                     
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewOrderMaterial, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />

                    <Controls:RadRadioButton 
            		    GroupName="Menu"
            		    x:Name="rrdEIPManagement"
            		    Content="NX thành phẩm"
            		    Click="OnChecked" 
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="Collapsed"
                    />
                </StackPanel>
            </TNavigation:RadPanelBarItem>

            <!--EmployeeManagement-->
            <TNavigation:RadPanelBarItem 
				Style="{StaticResource RadPanelBarItemStyle}"
                Visibility="{Binding Path=EmployeeManagementVisibility, Mode=OneWay}"
                >
                <TNavigation:RadPanelBarItem.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock 
                            Style="{StaticResource TextBlockMenuHeaderStyle}"
                            Text="{StaticResource EmployeeMangHeaderText}"
                        />
                    </DataTemplate>
                </TNavigation:RadPanelBarItem.HeaderTemplate>
                <StackPanel>
                    <Controls:RadRadioButton
                        GroupName="Menu"
                        x:Name="rrdEmployeeManagement"
                        Content="{StaticResource EmployeeMangButtonText}"
                        Click="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewEmployee, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                    <Controls:RadRadioButton
                        GroupName="Menu"
                        x:Name="rrdEmploymentTypeManagement"
                        Content="{StaticResource EmploymentTypeMangButtonText}"
                        Click="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                    Visibility="{Binding Path=Account.CanViewEmploymentType, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                    <Controls:RadRadioButton
                        GroupName="Menu"
                        x:Name="rrdRoleManagement"
                        Content="{StaticResource RoleMangButtonText}"
                        Click="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewRole, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                </StackPanel>
            </TNavigation:RadPanelBarItem>

            <!--PartnerManagement-->
            <TNavigation:RadPanelBarItem 
				Style="{StaticResource RadPanelBarItemStyle}"
                Visibility="{Binding Path=PartnerManagementVisibility, Mode=OneWay}"
                >
                <TNavigation:RadPanelBarItem.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock 
                            Style="{StaticResource TextBlockMenuHeaderStyle}"
                            Text="{StaticResource PartnerMangHeaderText}"
                        />
                    </DataTemplate>
                </TNavigation:RadPanelBarItem.HeaderTemplate>
                <StackPanel>
                    <Controls:RadRadioButton 
                        GroupName="Menu"
                        x:Name="rrdPartnerManagement"
                        Content="{StaticResource PartnerMangButtonText}"
                        Click="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewPartner, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                </StackPanel>
            </TNavigation:RadPanelBarItem>

            <!--GeneralMang-->
            <TNavigation:RadPanelBarItem 
				Style="{StaticResource RadPanelBarItemStyle}"
                Visibility="{Binding Path=GeneralManagementVisibility, Mode=OneWay}"
                >
                <TNavigation:RadPanelBarItem.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock 
                            Style="{StaticResource TextBlockMenuHeaderStyle}"
                            Text="{StaticResource GeneralMangHeaderText}"
                        />
                    </DataTemplate>
                </TNavigation:RadPanelBarItem.HeaderTemplate>
                <StackPanel 
                    Background="Transparent">
                    <Controls:RadRadioButton 
                        GroupName="Menu"
                        x:Name="rrdWarehouseManagement"
                        Content="{StaticResource WarehouseMangButtonText}"
                        Checked="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewWarehouse, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                    <Controls:RadRadioButton 
                        GroupName="Menu"
                        x:Name="rrdMaterialManagement"
                        Content="{StaticResource MaterialMangButtonText}"
                        Click="OnChecked"
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewMaterial, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                    <Controls:RadRadioButton 
            		    GroupName="Menu"
            		    x:Name="rrdProductManagement"
            		    Content="{StaticResource ProductMangButtonText}"
            		    Click="OnChecked" 
                        Style="{StaticResource RadRadioButtonMenuStyle}"
                        Visibility="{Binding Path=Account.CanViewProduct, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
                    />
                </StackPanel>
            </TNavigation:RadPanelBarItem>

        </TNavigation:RadPanelBar>
        
    </Grid>
</UserControl>
